//
//  DHGoodCell.m
//  宏达APP
//
//  Created by DIANGHONG on 2018/4/29.
//  Copyright © 2018年 123. All rights reserved.
//

#import "DHGoodCell.h"
#import <SDWebImage/UIImageView+WebCache.h>
@interface DHGoodCell()

@property (strong, nonatomic) IBOutlet UIImageView *goodImageView; // 商品招聘视图
@property (strong, nonatomic) IBOutlet UILabel *goodNameView; // 商品名称视图
@property (strong, nonatomic) IBOutlet UILabel *goodPriceView; // 商品价格视图
@property (strong, nonatomic) IBOutlet UIButton *selectedBtn; // 商品选用按钮

@end
@implementation DHGoodCell

- (void)setModel:(DHGoodListModel *)model{
    _model = model;

    [self.goodImageView sd_setImageWithURL:[NSURL URLWithString:model.goods_image_url]];
    self.goodNameView.text = model.goods_name;
    self.goodPriceView.text = [NSString stringWithFormat:@"¥%@",model.goods_price];
}

#pragma mark: - awakeFromNib
- (void)awakeFromNib{
    [super awakeFromNib];
    
    [self.selectedBtn addTarget:self action:@selector(selectButtonClick) forControlEvents:UIControlEventTouchUpInside];
}

#pragma mark: - 选用按钮监听
- (void)selectButtonClick{
    
    [self.delegate goodCellTapSelectedButton:self good:self.model];
}

@end
